/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package middleware;

/**
 * Implement this interface if you want to send your object between server and client
 * @author HO HOANG HUNG
 */
public interface Serializable {
    /**
     * serialize this object into this buffer array starting from offset index
     * @param buffer
     * @param offset
     * @return the new offset value
     */
    public int serialize(byte[] buffer,int offset);
    
    /**
     * Deserialize and store the value from this buffer starting from index
     * @param buffer
     * @param offset
     * @return the new index
     */
    public int deserialize(byte[] buffer,int offset);
}
